package a2;

import java.awt.Graphics2D;

public class RectangleArray {
	private Rectangle[] store = new Rectangle[4];
	
	public RectangleArray() {
	}
	
	public RectangleArray(int size) {
	}
	
	public Rectangle get(int i){
		return store[i];
	}
	
	public void add( Rectangle r){
		if (store[0] == null)
			store[0] = r;
		else if (store[1] == null)
			store[1] = r;
		else if (store[2] == null)
			store[2] = r;
		else if (store[3] == null)
			store[3] = r;
	}
	
	public void draw(Graphics2D g2d){
		if (store[0] != null)
			store[0].draw( g2d );
		if (store[1] != null)
			store[1].draw( g2d );
		if (store[2] != null)
			store[2].draw( g2d );
		if (store[3] != null)
			store[3].draw( g2d );
	}

}
